3.3 \(\int \frac{\cos ^2(x)}{a+a \csc (x)} \, dx\)

Optimal. Leaf size=27 \[ -\frac{x}{2 a}-\frac{\cos (x)}{a}+\frac{\sin (x) \cos (x)}{2 a} \]

[Out]

-x/(2*a) - Cos[x]/a + (Cos[x]*Sin[x])/(2*a)

________________________________________________________________________________________

Rubi [A]  time = 0.0911225, antiderivative size = 27, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.385, Rules used = {3872, 2839, 2638, 2635, 8} \[ -\frac{x}{2 a}-\frac{\cos (x)}{a}+\frac{\sin (x) \cos (x)}{2 a} \]

Antiderivative was successfully verified.

[In]

Int[Cos[x]^2/(a + a*Csc[x]),x]

[Out]

-x/(2*a) - Cos[x]/a + (Cos[x]*Sin[x])/(2*a)

Rule 3872

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.), x_Symbol] :> Int[((g*C
os[e + f*x])^p*(b + a*Sin[e + f*x])^m)/Sin[e + f*x]^m, x] /; FreeQ[{a, b, e, f, g, p}, x] && IntegerQ[m]

Rule 2839

Int[((cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.))/((a_) + (b_.)*sin[(e_.) + (f_
.)*(x_)]), x_Symbol] :> Dist[g^2/a, Int[(g*Cos[e + f*x])^(p - 2)*(d*Sin[e + f*x])^n, x], x] - Dist[g^2/(b*d),
Int[(g*Cos[e + f*x])^(p - 2)*(d*Sin[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, g, n, p}, x] && EqQ[a^2
 - b^2, 0]

Rule 2638

Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Cos[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 2635

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> -Simp[(b*Cos[c + d*x]*(b*Sin[c + d*x])^(n - 1))/(d*n),
x] + Dist[(b^2*(n - 1))/n, Int[(b*Sin[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && Integer
Q[2*n]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rubi steps

\begin{align*} \int \frac{\cos ^2(x)}{a+a \csc (x)} \, dx &=\int \frac{\cos ^2(x) \sin (x)}{a+a \sin (x)} \, dx\\ &=\frac{\int \sin (x) \, dx}{a}-\frac{\int \sin ^2(x) \, dx}{a}\\ &=-\frac{\cos (x)}{a}+\frac{\cos (x) \sin (x)}{2 a}-\frac{\int 1 \, dx}{2 a}\\ &=-\frac{x}{2 a}-\frac{\cos (x)}{a}+\frac{\cos (x) \sin (x)}{2 a}\\ \end{align*}

Mathematica [A]  time = 0.0337815, size = 27, normalized size = 1. \[ -\frac{x}{2 a}+\frac{\sin (2 x)}{4 a}-\frac{\cos (x)}{a} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[x]^2/(a + a*Csc[x]),x]

[Out]

-x/(2*a) - Cos[x]/a + Sin[2*x]/(4*a)

________________________________________________________________________________________

Maple [B]  time = 0.058, size = 87, normalized size = 3.2 \begin{align*} -{\frac{1}{a} \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{3} \left ( \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{2}+1 \right ) ^{-2}}-2\,{\frac{ \left ( \tan \left ( x/2 \right ) \right ) ^{2}}{a \left ( \left ( \tan \left ( x/2 \right ) \right ) ^{2}+1 \right ) ^{2}}}+{\frac{1}{a}\tan \left ({\frac{x}{2}} \right ) \left ( \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{2}+1 \right ) ^{-2}}-2\,{\frac{1}{a \left ( \left ( \tan \left ( x/2 \right ) \right ) ^{2}+1 \right ) ^{2}}}-{\frac{1}{a}\arctan \left ( \tan \left ({\frac{x}{2}} \right ) \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(x)^2/(a+a*csc(x)),x)

[Out]

-1/a/(tan(1/2*x)^2+1)^2*tan(1/2*x)^3-2/a/(tan(1/2*x)^2+1)^2*tan(1/2*x)^2+1/a/(tan(1/2*x)^2+1)^2*tan(1/2*x)-2/a
/(tan(1/2*x)^2+1)^2-1/a*arctan(tan(1/2*x))

________________________________________________________________________________________

Maxima [B]  time = 1.59781, size = 109, normalized size = 4.04 \begin{align*} \frac{\frac{\sin \left (x\right )}{\cos \left (x\right ) + 1} - \frac{2 \, \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} - \frac{\sin \left (x\right )^{3}}{{\left (\cos \left (x\right ) + 1\right )}^{3}} - 2}{a + \frac{2 \, a \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} + \frac{a \sin \left (x\right )^{4}}{{\left (\cos \left (x\right ) + 1\right )}^{4}}} - \frac{\arctan \left (\frac{\sin \left (x\right )}{\cos \left (x\right ) + 1}\right )}{a} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)^2/(a+a*csc(x)),x, algorithm="maxima")

[Out]

(sin(x)/(cos(x) + 1) - 2*sin(x)^2/(cos(x) + 1)^2 - sin(x)^3/(cos(x) + 1)^3 - 2)/(a + 2*a*sin(x)^2/(cos(x) + 1)
^2 + a*sin(x)^4/(cos(x) + 1)^4) - arctan(sin(x)/(cos(x) + 1))/a

________________________________________________________________________________________

Fricas [A]  time = 0.465767, size = 51, normalized size = 1.89 \begin{align*} \frac{\cos \left (x\right ) \sin \left (x\right ) - x - 2 \, \cos \left (x\right )}{2 \, a} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)^2/(a+a*csc(x)),x, algorithm="fricas")

[Out]

1/2*(cos(x)*sin(x) - x - 2*cos(x))/a

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \frac{\int \frac{\cos ^{2}{\left (x \right )}}{\csc{\left (x \right )} + 1}\, dx}{a} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)**2/(a+a*csc(x)),x)

[Out]

Integral(cos(x)**2/(csc(x) + 1), x)/a

________________________________________________________________________________________

Giac [A]  time = 1.3458, size = 59, normalized size = 2.19 \begin{align*} -\frac{x}{2 \, a} - \frac{\tan \left (\frac{1}{2} \, x\right )^{3} + 2 \, \tan \left (\frac{1}{2} \, x\right )^{2} - \tan \left (\frac{1}{2} \, x\right ) + 2}{{\left (\tan \left (\frac{1}{2} \, x\right )^{2} + 1\right )}^{2} a} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)^2/(a+a*csc(x)),x, algorithm="giac")

[Out]

-1/2*x/a - (tan(1/2*x)^3 + 2*tan(1/2*x)^2 - tan(1/2*x) + 2)/((tan(1/2*x)^2 + 1)^2*a)